home *** CD-ROM | disk | FTP | other *** search
-
- SiFLyiNG
- Tutorial #4
-
-
- ___________________________________________________________________________
-
- Target : Execution Crackme 0.1
- d/l it on EB site : http://crackme.cjb.net
- Protection Type : Serial/Name, VB5
- Level : 1 for serial sniffing, 2 for keygen (i think )
- Tools needed : SoftIce 3.xx
- WinDasm
- VB for keygen
- Basis of VB cracking
- ___________________________________________________________________________
-
- Before beginning...
-
- First of all i advise you EB tut 29 available on
- http://crackmes.cjb.net on how to find a serial for this crackme. In this
- tut i'll explain how to make a keygen wich calculates a valid serial in
- function of the name.
- So, you have read EB tutorial ??? now you are ready :)
-
- ___________________________________________________________________________
-
- The essay...
-
- This is a VB crackme. To get a valid serial, you make a breakpoint
- the comparison funtion __vbaStrComp ( string compare ). But in our case we
- want to make a keygen. Just remember what EB says in his tut : 'this program
- requires a code which is based on your name that is converted in upper case.'
- Upper case ? so our enry point will be the call to the function which converts
- our name in Upper Case : but what's the name of this function ? Hummm, let's
- use WinDasm in order to find the name of this function. Dasm the crackme
- and look at the imports in Functions/Imports. What do we find :
- rtcUpperCaseVar seems interesting :) So bpx on it, exit from Sice, enter
- any name, any code... and press 'Register'
- There we're back to SoftIce. Return from the call with F11. You see
- that code :
-
- * Reference To: MSVBVM50.rtcUpperCaseVar, Ord:0210h
- |
- :0040D96F Call dword ptr [0040F13C]
- :0040D975 lea eax, dword ptr [ebp-54]
- :0040D978 push eax
-
- Now, we're in the code but it's not very interesting. If you trace
- with F10, you'll soon reach this piece of code, wich is the beginning of
- the loop wich calculates the serial :
-
- * Referenced by a (U)nconditional or (C)onditional Jump at Address:
- |:0040DAFE(U)
- |
- :0040D9BC cmp si, word ptr [ebp+FFFFFF48] ;compare esi with len of name
- :0040D9C3 jg 0040DB03 ; jump out of the loop if esi > len of name
- :0040D9C9 lea ecx, dword ptr [ebp-28] ; wich means that the end of the name
- :0040D9CC lea edx, dword ptr [ebp-44] ; has been reached.
- :0040D9CF movsx eax, si
- :0040D9D2 mov dword ptr [ebp-7C], ecx
- :0040D9D5 push edx
- :0040D9D6 lea ecx, dword ptr [ebp+FFFFFF7C]
- :0040D9DC push eax
- :0040D9DD lea edx, dword ptr [ebp-54]
- :0040D9E0 push ecx
- :0040D9E1 push edx
- :0040D9E2 mov [ebp-3C], 00000001
- :0040D9E9 mov [ebp-44], 00000002
- :0040D9F0 mov dword ptr [ebp+FFFFFF7C], 00004008
-
- * Reference To: MSVBVM50.rtcMidCharVar, Ord:0278h
- |
- :0040D9FA Call dword ptr [0040F130]
- :0040DA00 lea eax, dword ptr [ebp-54]
- :0040DA03 push eax
-
- The mid Function returns a variant (string) contaigning a specified
- number of characters from a string. Here it returns a char from the entered
- name, used to calculate the serial. At each loop, it returns the next char
- until it has reached the end of the name (test at adress 0040D9C3) .
-
- * Reference To: MSVBVM50.__vbaStrVarMove, Ord:0000h
- |
- :0040DA04 Call dword ptr [0040F0F4]
- :0040DA0A mov edx, eax ; type 'd eax' and you'll see the
- :0040DA0C lea ecx, dword ptr [ebp-18] ; returned char of the name in
- :0040DA0F call ebx ; upper case.
- :0040DA11 lea ecx, dword ptr [ebp-54]
- :0040DA14 lea edx, dword ptr [ebp-44]
- :0040DA17 push ecx
- :0040DA18 push edx
- :0040DA19 push 00000002
-
- * Reference To: MSVBVM50.__vbaFreeVarList, Ord:0000h
- |
- :0040DA1B Call dword ptr [0040F0FC]
- :0040DA21 mov eax, dword ptr [ebp-18]
- :0040DA24 add esp, 0000000C
- :0040DA27 push eax
-
- * Reference To: MSVBVM50.rtcAnsiValueBstr, Ord:0204h
- |
- :0040DA28 Call dword ptr [0040F108]
-
- This funtion returns in eax the value of the char in upper case of the name
- Example : 'S' = 53h => eax = 53 or ax = 53
-
- :0040DA2E sub ax, 0040 ; ax = ax-40h
- :0040DA32 jo 0040DCD9 ; jump to the error message if overflow
- :0040DA38 imul ax, 0082 ; ax = ax * 82h
- :0040DA3D jo 0040DCD9
- :0040DA43 add ax, di ; ax = ax + di (di=0 at the beginning of the loop)
- :0040DA46 jo 0040DCD9
- :0040DA4C add ax, 0050 ; ax = ax + 50h
- :0040DA50 jo 0040DCD9
- :0040DA56 add ax, 0050 ; ax = ax + 50h
- :0040DA5A jo 0040DCD9
- :0040DA60 add ax, 0050 ; ax = ax + 50h
- :0040DA64 jo 0040DCD9
- :0040DA6A add ax, 0050 ; ax = ax + 50h
- :0040DA6E jo 0040DCD9
- :0040DA74 add ax, 0050 ; ax = ax + 50h
- :0040DA78 jo 0040DCD9
- :0040DA7E add ax, 0050 ; ax = ax + 50h
- :0040DA82 jo 0040DCD9
- :0040DA88 add ax, 0050 ; ax = ax + 50h
- :0040DA8C jo 0040DCD9
- :0040DA92 add ax, 0050 ; ax = ax + 50h
- :0040DA96 jo 0040DCD9
- :0040DA9C add ax, 0050 ; ax = ax + 50h
- :0040DAA0 jo 0040DCD9
- :0040DAA6 add ax, 0050 ; ax = ax + 50h
- :0040DAAA jo 0040DCD9
- :0040DAB0 add ax, 0050 ; ax = ax + 50h
- :0040DAB4 jo 0040DCD9
- :0040DABA add ax, 0050 ; ax = ax + 50h
- :0040DABE jo 0040DCD9
- :0040DAC4 add ax, 0050 ; ax = ax + 50h
- :0040DAC8 jo 0040DCD9
- :0040DACE add ax, 0050 ; ax = ax + 50h
- :0040DAD2 jo 0040DCD9
- :0040DAD8 add ax, 0050 ; ax = ax + 50h
- :0040DADC jo 0040DCD9
- :0040DAE2 add ax, 0050 ; ax = ax + 50h
- :0040DAE6 jo 0040DCD9
- :0040DAEC mov edi, eax ; store eax in edi to use it at the next loop
- :0040DAEE mov eax, 00000001 ; eax = 1 -
- :0040DAF3 add ax, si ; ax = ax + si | these lines increase esi
- :0040DAF6 jo 0040DCD9 |
- :0040DAFC mov esi, eax ; esi = eax -
- :0040DAFE jmp 0040D9BC ; jump to next char of the name
-
- Thus, this loop depends on the len of the entered name. It uses all
- char of the name in upper case. And the result is each time stored in edi at
- 40DAEC. So that, when the loop has ended and it jumps from 40D9C3 to 40DB03,
- the serial is in edi... and will finally be converted in a string then compared
- with the entered serial. Ok, now we know how to make a keygen for this
- crackme. So let's go...
-
- ____________________________________________________________________________
-
- The Keygen... in VB
-
- First of all, the name is converted in Upper Case (very important).
-
- user_name = UCase$(user_name)
- edi = 0
-
- ... then the loop :
-
- For i= 1 to len(user_name)
-
- Char_name = Asc(Mid$(user_name, i, 1)) 'this will return
- 'the char(i) from the name
- eax = Char_name
- eax = eax - &h40 ' ax = ax - 40h
- eax = eax * &h82 ' ax = ax * 82h
- eax = eax + edi
- eax = eax + (&h50 * 16) ' add 50h 16 times to ax
- edi = eax ' stores eax in edi
-
- Next i ' ends the loop
-
- Serial = edi ' at the last loop, the serial is in edi
-
- Voilα, the keygen routine is finished. You can make a form with
- a couple of TextBox and a CommandButton and use this routine in the Command
- click event. The name is entered in one textbox and the serial retrieves
- in the second one.
-
- But you should note all the jo 0040DCD9 in the source code. It means
- that if your serial is upper to 32768= 2^15, you will have a overflow
- MessageBox in the crackme. So if you wanna perfect your keygen you could
- add a msgbox which appears is the serial is upper to 32768.
- Note also that your serial could be lower to 0 if the name is mainly
- composed with numbers. Example: name= 123456 / serial= -2070. Just try and
- you'll see. So your keygen mustn't ignore the '-'.
- Ok, i think it should be enough for making a great Key Generator.
- This is quite easy, isn't it ? And lots of softwares uses such a routine !
- And isn't it better to provide a Keygen rather than a serial ? or a crack ?
-
- ____________________________________________________________________________
-
- The end...
-
- What to say more ? hummm... I can't see. If you don't understand, or
- have critics, remarks... just send a mail at siflying@ifrance.com.
-
- SiFLyiNG
-
- Greetz : i wanna thank HackerG from Execution for his crackme.
- Eternal Bliss, Acid Burn, Carpathia, Lucifer48, Glu, Ear
- and the others I've forgotten...
-
-
-
-